Conversation
orronai
commented
Oct 5, 2021
- Added tags per course
- Added for the exercises.html template the tags
- Added the tables of the tags
- Added a test
- Added tags per course - Added for the exercises.html template the tags - Added the tables of the tags - Added a test
Codecov Report
@@ Coverage Diff @@
## master #326 +/- ##
==========================================
+ Coverage 84.08% 84.36% +0.28%
==========================================
Files 63 64 +1
Lines 2903 2955 +52
==========================================
+ Hits 2441 2493 +52
Misses 462 462
Continue to review full report at Codecov.
|
- Added a bridge of tags in models folder - Added course and date_created column to the tags table - Added a constraint to the tags table
| @classmethod | ||
| def get_objects( | ||
| cls, user_id: int, fetch_archived: bool = False, | ||
| from_all_courses: bool = False, exercise_tag: Optional[str] = None, |
There was a problem hiding this comment.
We should find a better way. Creating these godlike functions with trillion parameters is a bad habit. Can you please find another way to do it?
There was a problem hiding this comment.
I don't really find a better way
| def of_user( | ||
| cls, user_id: int, with_archived: bool = False, | ||
| from_all_courses: bool = False, | ||
| from_all_courses: bool = False, exercise_tag: Optional[str] = None, |
There was a problem hiding this comment.
Same - we should try not to write such godlike functions
- Splitted a function into 3 functions - Changed some functions names
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.07%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
| ) | ||
|
|
||
|
|
||
| @webapp.route('/exercises/<tagname>') |
There was a problem hiding this comment.
Maybe /exercises/tag/<tagname>? Or /tags/exercise/_ in case we'll want to tag other things in the future (users, maybe?)
| instance.delete_instance() | ||
|
|
||
|
|
||
| class Tag(BaseModel): |
There was a problem hiding this comment.
I now think about changing this tablename to ExerciseTag, and the connection to ExerciseToTag, in order to allow easy future expansion of the tags to user. IDK what the right approach to a state where we have both Users and Exercises that use tags, but I have a strong hunch that they shouldn't share the same table.